import './index.scss'
import 'react-tabs/style/react-tabs.css'
import NetView from '../NetView'
import { useContext } from 'react'
import { Context } from '@/pages/Dubber'
import { Spin } from 'antd'

const NetPage = ({ loading }) => {
  let updateTree = useContext(Context)

  return (
    <>
      {loading ? (
        <Spin tip='加载中'>
          <div className='loading-page'></div>
        </Spin>
      ) : (
        <div className="net-container animate__animated animate__zoomIn">
          <div className="tabs">
            {updateTree && updateTree.data && updateTree.data.nodes ? (
              <NetView updateTree={updateTree} />
            ) : (
              ''
            )}
          </div>
        </div>
      )}
    </>
  )
}

export default NetPage
